package utils;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

/**
 * 连接ip+端口
 *
 * @author：PZ
 * @Date: 2020/12/9 15 47
 */
public class ElasticSearchClient {
    public static RestHighLevelClient getClient() {
        HttpHost httpHost = new HttpHost("106.52.36.102", 9200);
        RestClientBuilder builder = RestClient.builder(httpHost);
        RestHighLevelClient client = new RestHighLevelClient(builder);
        return client;
    }
}
